package com.leyou.page.handler;

import com.leyou.page.entity.Brand;
import com.leyou.page.service.GoodsPageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;

@Component
@CanalTable("tb_brand")
public class BrandHandler implements EntryHandler<Brand> {
    @Autowired
    private GoodsPageService pageService;

    @Override
    public void insert(Brand brand) {
        pageService.loadBrandData(brand.getId());
    }
    @Override
    public void update(Brand before,Brand after) {
        pageService.loadBrandData(after.getId());
    }

    @Override
    public void delete(Brand brand) {
        pageService.deleteBrand(brand.getId());
    }

}



